package com.asiainfo.order.fallcak;

import com.asiainfo.entity.product.Product;
import com.asiainfo.order.feign.ProductFeign;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * 回调类，只有发生异常时，会掉这里面的方法
 */
@Component
public class ProductFeignClientFallback implements ProductFeign {
    @Override
    public Product getProductById(Long productId) {
        return  new Product(0L,new BigDecimal(0),"未知商品",0);
    }
}
